package com.jxs.android.weiget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.telecom.weixi.R;

public class BuProductView extends LinearLayout {
	private TextView prodName;
	private TextView prodType;
	private TextView prodState;
	private TextView joinDate;
	private TextView joinAge;
	private TextView netGrid;
	private TextView userAddr;
	private TextView userExtra;

	private TextView conect_name;
	private TextView conect_phone;
	private TextView conect_address;

	public void setStateTxtColor(int color) {
		prodState.setTextColor(color);
	}

	public void setProdName(String value) {
		prodName.setText(value);
	}

	public void setProdType(String value) {
		prodType.setText(value);
	}

	public void setProdState(String value) {
		prodState.setText(value);
	}

	public void setJoinDate(String value) {
		joinDate.setText(value);
	}

	public void setJoinAge(String value) {
		joinAge.setText(value);
	}

	public void setNetGrid(String value) {
		netGrid.setText(value);
	}

	public void setUserAddr(String value) {
		userAddr.setText(value);
	}

	public void setUserExtra(String value) {
		userExtra.setText(value);
	}

	public void initFixContent(String name, String type, String state, String date, String age, String grid, String addr, String extra) {
		setProdName(name);
		setProdType(type);
		setProdState(state);
		setJoinDate(date);
		setJoinAge(age);
		setNetGrid(grid);
		setUserAddr(addr);
		setUserExtra(extra);
	}

	public void setConect_name(String conect_name) {
		this.conect_name.setText(conect_name);
	}

	public void setConect_phone(String conect_phone) {
		this.conect_phone.setText(conect_phone);
	}

	public void setConect_address(String conect_address) {
		this.conect_address.setText(conect_address);
	}

	public BuProductView(Context context) {
		this(context, null);
	}

	public BuProductView(Context context, AttributeSet attrs) {
		super(context, attrs);
		LayoutInflater flater = LayoutInflater.from(context);
		flater.inflate(R.layout.bu_search_product_view, this);
		prodName = (TextView) findViewById(R.id.prod_name);
		prodType = (TextView) findViewById(R.id.prod_type);
		prodState = (TextView) findViewById(R.id.prod_state);
		joinDate = (TextView) findViewById(R.id.join_date);
		joinAge = (TextView) findViewById(R.id.join_age);
		netGrid = (TextView) findViewById(R.id.net_grid);
		userAddr = (TextView) findViewById(R.id.user_addr);
		conect_name = (TextView) findViewById(R.id.conect_name);
		conect_phone = (TextView) findViewById(R.id.conect_phone);
		conect_address = (TextView) findViewById(R.id.conect_address);
		userExtra = (TextView) findViewById(R.id.user_extra);
		userExtra.setLineSpacing(3, 1);
		// test();
	}
}